﻿Public Class Form4

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim saveFileDialog1 As New SaveFileDialog()

        saveFileDialog1.Filter = "Archivos de Texto (*.txt)|*.txt"

        saveFileDialog1.ShowDialog()

        If saveFileDialog1.FileName <> "" Then

            FileOpen(1, saveFileDialog1.FileName, OpenMode.Output)

            PrintLine(1, RichTextBox1.Text)

            FileClose(1)

        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Dispose()
    End Sub
    Public Sub Datos(ByVal texto As String, ByVal valor As Double)
        RichTextBox1.Text = texto & Global.Microsoft.VisualBasic.ChrW(10) + " Reporte del dia " & Global.Microsoft.VisualBasic.ChrW(10) + valor.ToString
    End Sub
End Class